import request, { Method, buyerUrl, managerUrl } from '@/plugins/request.js'

// 获取首页楼层装修数据
export function indexData (params) {
  console.log(buyerUrl,99887);
  return request({
    url: buyerUrl+'/buyer/other/pageData/getIndex',
    method: Method.GET,
    needToken: false,
    params
  })
}

/**
 * 楼层装修数据
 * @param pageClientType 客户端类型,可用值:PC,H5,WECHAT_MP,APP
 * @param pageType 页面类型,可用值:INDEX,STORE,SPECIAL
 */
export function pageData (params) {
  return request({
    url: buyerUrl+`/buyer/other/pageData`,
    method: Method.GET,
    needToken: false,
    params
  })
}
/**
 * 刷新token
 */
export function handleRefreshToken (token) {
  return request({
    url: buyerUrl+`/buyer/passport/member/refresh/${token}`,
    method: Method.GET,
    needToken: false
  })
}

// 全平台搜索
export function getSearchPage (data) {
  return request({
    url: `${managerUrl}/manager/search/ES/search`,
    method: Method.POST,
    needToken: true,
    data,
    headers: {
      "Content-Type": "application/json"
    }
  })
}